<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id='start'>开始</button>
    <button id='end'>结束</button>
    <h1 id='txt'>请开始抽奖</h1>
    <script>
        var list=['鞋一双','篮球一个','兵乓球一个','足球一个','排球一个'];
        var start=document.getElementById('start');
        var end=document.getElementById('end');
        var txt=document.getElementById('txt');
           
        var timer;
        start.onclick=function(){
            clearInterval(timer);
            timer=setInterval(function(){
           n=parseInt(Math.random()*list.length);
            txt.innerHTML=list[n];
            },100)
        }
        end.onclick=function(){
            clearInterval(timer);
        }
       
    </script>
</body>
</html>